﻿using System;
using System.Collections.Generic;
using System.Text;
using Antu.Business.AbstractClass;
using Antu.Business.Inheritance;

namespace Antu.Business.Business
{
    /// <!--
    /// 功能描述  : 数据转换工厂
    /// 创建人  : LinJian
    /// 创建时间: 2007-07-09
    /// -->
    public class DataTranslationFactory
    {
        private static string[] arrStrTables;

        /// <summary>
        ///进行数据交换的表
        /// </summary>
        public static string[] ExportTables
        {
            get
            {
                return arrStrTables;
            }
        }

        /// <summary>
        /// 创建数据转换实例
        /// </summary>
        /// <param name="opType">转换类型</param>
        /// <returns></returns>
        public static AbstractDataOperation CreateDataOperation(OperationType opType)
        {
            AbstractDataOperation absData = null;

            switch (opType)
            {
                case OperationType.UserSignExchange:  //用户签名数据倒换
                    absData = new ExportUserSign();
                    arrStrTables = SystemConfig.NeedExportUserSignTables;
                    break;
                case OperationType.WuYeRegisterExchange:
                    absData = new PropertyRegisterDataOperation();
                    arrStrTables = SystemConfig.NeedExportWyRegisterTables;
                    break;
                case OperationType.WuYeRequestExchange:
                    absData = new PropertyRequestDataOperation();
                    arrStrTables = SystemConfig.NeedExportWyTables;
                    break;
                case OperationType.ChaiQianSysExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportCqTables;
                    break;
                case OperationType.TaskDataExchange:
                    absData = new TaskDataOperation();
                    arrStrTables = SystemConfig.NeedExportTaskTables;
                    break;
                case OperationType.ZlQueryExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportZlTables;
                    break;
                case OperationType.WyRepairExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportWywxTables;
                    break;
                case OperationType.JjRequestExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportJjTables;
                    break;
                case OperationType.PgRequestExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportPgTables;
                    break;
                case OperationType.ZfRequestExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportZfTables;
                    break;
                case OperationType.QxTaskDateExchange:
                    absData = new QxTaskDataOperation();
                    arrStrTables = SystemConfig.NeedExportQxTables;
                    break;
                case OperationType.HouseStructExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportFwjgTables;
                    break;
                case OperationType.GongFangExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportgfTables;
                    break;
                case OperationType.BaozfExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportbzfTables;
                    break;
                case OperationType.ZhengshouExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportzsTables;
                    break;
                case OperationType.GuoTaidataExchange:
                    absData = new CommonDataOperation();
                    arrStrTables = SystemConfig.NeedExportgtTables;
                    break;
            }

            return absData;
        }

    }
}
